"""
進入爱逛卖家版
"""
import time

import yaml
from uiautomator2 import xpath

from page_object.add_market_page import AddGoodsPage
from page_object.base_page import BasePage
from page_object.guang_page import GuangPage
from page_object.setting_page import SettingPage
from resource.path_info import *

"""
橱窗商品列表
"""
class PreviewPage(GuangPage):

    def get_preview_good_lists(self, d):
        print("get stock good name")
        pre_lists = []
        for i in range(1,5,1):
            if d.xpath(previewGoodsTitle_xpath %i).exists:
                pre_lists.append(d.xpath(previewGoodsTitle_xpath %i).get_text())
        print(pre_lists)
        return pre_lists


    def checkPreviewLists(self, d,shopWinLists, previewLists):
        for name in previewLists:
            if name in shopWinLists:
                continue
            else:
                raise Exception("can not find name in previewLists")
        d.press("back")
